﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Xoohoo.ModelValidation.Attributes;

namespace Xoohoo.Modules.Admin.Models
{
    public class UserChangeProfileInput
    {
        public UserChangeProfileInput() { }
        public UserChangeProfileInput(/*string username,*/ string displayName, string email)
        {
            //Username = username;
            DisplayName = displayName;
            Email = email;
        }

        //public string Username { get; set; }
        [Required(ErrorMessage = "昵称不能为空")]
        [StringLength(20, MinimumLength = 2, ErrorMessage = "昵称请保持在2-20个字符之间")]
        [SlugWithChinese(ErrorMessage = "以字母或中文开头的中文字母数字_和-组成")]
        [DisplayName("昵称")]
        public string DisplayName { get; set; }

        [Required(ErrorMessage = "邮箱地址不能为空")]
        [StringLength(100, ErrorMessage = "邮箱地址请保持在100个字符以内")]
        [Email(ErrorMessage = "邮箱地址格式不正确")]
        [DataType(DataType.EmailAddress)]
        [DisplayName("邮箱地址")]
        public string Email { get; set; }
    }
}
